function resizeImage(newWidth,newHeight,fixWidth,fixHeight){ 
	var ratio=fixWidth/newWidth;	
	if(ratio>fixHeight/newHeight)ratio=fixHeight/newHeight;	
	this.width=newWidth*ratio;
	this.height=newHeight*ratio;
}